#ifndef FGE_ASSETMANAGER_HPP
#define FGE_ASSETMANAGER_HPP

#include <string>
#include <map>
#include <utility>

namespace fge
{

class DeminaAnimation;
class SpriteAnimation;
class Song;
class SoundEffect;
class Texture;
class Font;
class TextureDictionary;
struct TextureRegion;

class AssetManager
{
public:
	AssetManager(const std::string &assetPath = "assets/");
	~AssetManager();

	std::string GetAssetPath() const { return assetPath; }

	std::pair<Texture*, TextureRegion> LoadTextureWithRegion(const std::string &fileName);

	Texture *LoadTexture(const std::string &fileName, TextureRegion *region = 0);
	TextureDictionary *LoadTextureDictionary(const std::string &dictionaryFile, const std::string &imageFile);
	DeminaAnimation* LoadDeminaAnimation(const std::string &fileName);
	SpriteAnimation* LoadSpriteAnimation(const std::string &fileName);
	Song* LoadSong(const std::string &fileName);
	SoundEffect* LoadSoundEffect(const std::string &fileName);
	Font* LoadFont(const std::string &fileName);

private:
	std::string assetPath;

	std::map<std::string, Texture*> textures;
	std::map<std::string, TextureDictionary*> textureDictionaries;
	std::map<std::string, DeminaAnimation*> deminaAnimations;
	std::map<std::string, SpriteAnimation*> spriteAnimations;
	std::map<std::string, Song*> songs;
	std::map<std::string, SoundEffect*> soundEffects;
	std::map<std::string, Font*> fonts;
};

}

#endif//FGE_ASSETMANAGER_HPP
